package com.fintech.third.service.moxie;

import java.util.List;
import java.util.Map;

import com.fintech.common.util.ApiResponse;
import com.fintech.third.model.MoxieTaskInfo;
import com.fintech.third.model.moxie.MoXieTaskResult;
import com.fintech.third.model.moxie.MoXieTaskType;
import com.fintech.third.model.moxie.MoxieResponse;
import com.fintech.third.model.moxie.RealNameAuthentication;
import com.fintech.third.model.moxie.alipay.MXAlipayReport;
import com.fintech.third.model.moxie.alipay.MXAlipayZmsReport;
import com.fintech.third.model.moxie.carries.AllDataDetails;
import com.fintech.third.model.moxie.carries.BillDetail;
import com.fintech.third.model.moxie.carries.MXUserReportCall;
import com.fintech.third.model.moxie.carries.MobileBasicV3;
import com.fintech.third.model.moxie.carries.NumberReport;
import com.fintech.third.model.moxie.carries.ShortMessageDetailV2;
import com.fintech.third.model.moxie.carries.VoiceCallDetailList;
import com.fintech.third.model.moxie.carriesv2.MXReport;
import com.fintech.third.model.moxie.chsi.StudentInfoList;
import com.fintech.third.model.moxie.fund.BillRecord;
import com.fintech.third.model.moxie.fund.LoanInfo;
import com.fintech.third.model.moxie.fund.LoanRepayRecord;
import com.fintech.third.model.moxie.fund.UserFundRecord;
import com.fintech.third.model.moxie.fund.UserInfo;
import com.fintech.third.model.moxie.insurance.InsurancePolicy;
import com.fintech.third.model.moxie.mail.EmailBillInstallmentList;
import com.fintech.third.model.moxie.mail.EmailBillList;
import com.fintech.third.model.moxie.mail.EmailBillShoppingSheetList;

import net.sf.json.JSONObject;

public interface MoXieService {

	/**
	 * 创建网银任务获取token_id
	 * 
	 * @param json
	 * @return
	 */
	public String createBankTask(JSONObject json);

	/**
	 * 创建电信运营商任务获取token_id
	 * 
	 * @param json
	 * @return
	 */
	public String createCarrierTask(JSONObject json);
	
	/**
	 * 检验验证码
	 * @param code 短信验证码
	 * @return
	 */
	public String verifySMSCode(String taskId,String code);

	/**
	 * 获取手机基本信息
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @param mobile
	 * @return
	 */
	public MobileBasicV3 obtainUseMobileBasic(String taskId, String mobile);

	/**
	 * 查询用户报告
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @return
	 */
	public ApiResponse<NumberReport> obtainUserMobileReport(Map<String, String> map, String mobile,String serialNum,String loanId,String channel);
	
	
	/**
	 * 查询用户报告v2
	 * @param map
	 * @param mobile
	 * @param serialNum
	 * @param loanId
	 * @param channel
	 * @return
	 */
	public ApiResponse<MXReport> obtainUserMobileReportV2(Map<String, String> map, String mobile,String serialNum,String loanId, String channel);
	

	/**
	 * 获取账号账单记录
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @param mobile
	 * @return
	 */
	public BillDetail obtainUserBills(String mobile, Map<String, String> map);

	/**
	 * 获取账号通话详情
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @param mobile
	 * @return
	 */
	public VoiceCallDetailList obtainUserVoiceCalls(String mobile, Map<String, String> map);
	
	
	/**
	 * 获取账号短信详情
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @param mobile
	 * @return
	 */
	public ShortMessageDetailV2 obtainUserShortMessages(String mobile, Map<String, String> map);
	
	
	/**
	 * 获取账号运营商全部数据的聚合接口
	 * 
	 * @param taskId
	 *            电信运营商token_id
	 * @param mobile
	 * @return
	 */
	public ApiResponse<AllDataDetails> obtainAllDataDetails(String mobile,String taskId,String serialNum,String loanId,String channel);
	

	/**
	 * 创建学信网任务获取token_id
	 * 
	 * @param json
	 * @return
	 */
	public String createChsiTask(JSONObject json);

	/**
	 * 获取学籍信息
	 * 
	 * @param taskId
	 *            学信网的token_id
	 * @return
	 */
	public StudentInfoList obtainStudentInfo(String taskId);

	/**
	 * 创建住房公积金任务获取token_id
	 * 
	 * @param json
	 * @return
	 */
	public MoxieResponse createFundTask(Map<String, String> map);
	
	

	/**
	 * 查询公积金全部信息
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public ApiResponse<UserFundRecord> obtainUserFundRecord(String taskId ,String serialNum,String loanId, String channel);

	/**
	 * 查询公积金基本信息
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public UserInfo obtainUserFundBaseRecord(String taskId);

	/**
	 * 查询公积金缴存信息
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public List<BillRecord> obtainUserFundExitRecord(String taskId);

	/**
	 * 查询贷款信息
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public List<LoanInfo> obtainUserFundBorrowRecord(String taskId);

	/**
	 * 查询还款信息
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public List<LoanRepayRecord> obtainUserFundRepayRecord(String taskId);

	/**
	 * 创建信用卡账单任务获取token_id
	 * 
	 * @param json
	 * @return
	 */
	public String createMailTask(JSONObject json);

	/**
	 * 查询信用卡账单
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public EmailBillList obtainCreditBillRecord(String taskId);

	/**
	 * 查询信用卡账单消费记录
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public EmailBillShoppingSheetList obtainCreditConsumBillRecord(String taskId);

	/**
	 * 查询信用卡账单分期
	 * 
	 * @param taskId
	 *            住房公积金token_id
	 * @return
	 */
	public EmailBillInstallmentList obtainCreditConsumPeriodBillRecord(String taskId);
	
	
	
	/**
	 * 创建车险保单任务
	 * 
	 * @param json
	 * @return
	 */
	public String createInsurancePolicyTask(JSONObject json);
	
	
	/**
	 * 查询车险数据
	 * 
	 * @param json
	 * @return
	 */
	public InsurancePolicy obtainPolicyData(String taskId);

	
	public String getCityData();
	
	/**
	 * 创建运营商数据任务版本2
	 * @param map
	 */
	public MoxieResponse createCarrierTaskV2(Map<String, String> map) ;
	
	
	/**
	 * 验证短信验证码版本2
	 * @param map
	 */
	public MoxieResponse verifySMSCodeV2(Map<String, String> map);
	
	
	
	/**
	 * 用户手机号是否实名认证
	 * @param map
	 */
	public ApiResponse<RealNameAuthentication> realNameAuthentication(Map<String, String> map);
	
	
	
	
	/**
	 * 查询运营商认证状态
	 * @param map
	 */
	public MoxieTaskInfo searchCarrierStatus(String loanId);
	
	
	
	/**
	 * 查询运营商taskId状态
	 * @param map
	 */
	public boolean taskIdStatusIsFail(String taskId);
	
	/**
	 * 
	 * @Title: createCarrierTaskForMall   
	 * @Description:  创建运营商数据任务(商城用)
	 * @param:      
	 * @return: MoxieResponse      
	 * @throws
	 */
	public MoxieResponse createCarrierTaskForMall(Map<String, String> map) ;
	
	
	/**
	 * 直接创建获取魔蝎任务
	 * @param map
	 * @return
	 */
	public MoxieResponse createMoxieTask(Map<String, String> map) ;
	
	/**
	 * 
	 * @Title: getCarrierTaskStatus   
	 * @Description:查询魔蝎运营商数据查询情况（商城用）  
	 * @param:      
	 * @return: String      
	 * @throws
	 */
	public String getCarrierTaskStatus(String loanId);
	
	/**
	 * 
	 * @Title: verifySMSCodeForMall   
	 * @Description:  验证魔蝎验证码（商城用）
	 * @param:      
	 * @return: MoxieResponse      
	 * @throws
	 */
	public MoxieResponse verifySMSCodeForMall(Map<String, String> map);
	
	
	/**
	 * 根据serialNum查询魔蝎数据
	 * @param serialNum
	 * @return
	 */

	public Map<String, Object> queryMxDataInfo(Map<String, String> map);
	
	
	public Map<String, Object> queryMxDataInfo(Map<String, String> map, String productType);
	
	/**
	 * 获取支付宝报告
	 * @param mobile
	 * @param taskId
	 * @param serialNum
	 * @param loanId
	 * @param channel
	 * @return
	 */
	public ApiResponse<MXAlipayReport> alipayReportV6(String mobile, String taskId, String serialNum,
			String loanId, String channel);
	
	/**
	 * 获取支付宝芝麻分报告
	 * @param mobile
	 * @param taskId
	 * @param serialNum
	 * @param loanId
	 * @param channel
	 * @return
	 */
	public ApiResponse<MXAlipayZmsReport> alipayZmsReportV2(String mobile, String taskId, String serialNum,
			String loanId, String channel);
	
	/**
	 * 主动通过taskid去拉取运营商数据
	 * @param taskId
	 * @return
	 */
	public MoXieTaskResult runMoXieCarrierTask(String taskId, String loanId);
	
	/**
	 * 主动通过taskid去拉取支付宝数据
	 * @param taskId
	 * @return
	 */
	public MoXieTaskResult runMoXieAlipayTask(String taskId, String loanId);
	
	/**
	 * 主动拉取魔蝎message信息
	 * @param loanId
	 * @param moXieTaskType
	 * @return
	 */
	public MXUserReportCall getReportMessage(String loanId, MoXieTaskType moXieTaskType);
	
	/**
	 * 查询需要跑批的任务 入库30S后才开始查
	 * @param type
	 * @return
	 */
	public List<MoxieTaskInfo> selectMoxieTaskInfo(String type);
	
	/**
	 * 如果15分钟了还在处理中，那么就转为未处理，重新进行处理
	 * @return
	 */
	public int updateMoxieProcessing();
}
